<template>
	<view class="page-view">
		<net-image src="images/ad/00_1.png" mode="widthFix" class="ad1"></net-image>
		<net-image src="images/gif/00_2.gif" mode="widthFix" class="ad2"></net-image>
		<net-image src="images/gif/00_3.gif" mode="widthFix" class="ad3"></net-image>
		<net-image src="images/gif/00_4.gif" mode="widthFix" class="ad4"></net-image>
		<net-image src="images/gif/00_5.gif" mode="widthFix" class="ad5" @click="gomap"></net-image>
	</view>
</template>

<script>
	import NetImage from '@/components/netImage.vue'
	import {SETTINGS, COMMON_SHARE} from '@/utils/const.js'
	import {reportEvent} from '@/services/miniApi.js'
	export default {
		timerId: null,
		components:{
			NetImage	
		},
		data() {
			return {

			}
		},
		methods: {
			gomap() {
				reportEvent('cikexiangweilai')
				uni.switchTab({
					url: '/pages/index/index'
				})
			},

		},
		onShow(){
			if(this.timerId != null){
				clearTimeout(this.timerId)
			}
			//服务器设置的时间大于0，则等待这个时间自动跳转，否则一直停留，等用户手动触发
			if(SETTINGS.AD_TIMES > 0){
				this.timerId = setTimeout(()=>{
					this.timerId = null
					this.gomap()
				}, SETTINGS.AD_TIMES)
			}
		},
		onHide(){
			if(this.timerId != null){
				clearTimeout(this.timerId)
			}
		},
		onShareAppMessage() {
			return COMMON_SHARE
		}
	}
</script>

<style>

	.page-view{
		background: #0f2741;
	}
	.ad1 {
		/* width: 750rpx; */
		position: absolute;
		top: 0rpx;
		left: 0rpx;
	}

	.ad2 {
		position: absolute;
		/* width: 150rpx; */
		top: 351rpx;
		left:0rpx;
	}

	.ad3 {
		position: absolute;
		/* width: 300rpx; */
		top: 415rpx;
		left: 515rpx;
	}

	.ad4 {
		position: absolute;
		/* width: 350rpx; */
		top: 1096rpx;
		left: 44rpx;
	}

	.ad5 {
		position: absolute;
		/* width: 400rpx; */
		top: 1179rpx;
		left: 249rpx;
	}
</style>
